<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件练习</title>
</head>
<body>
    <p id="demo">点击弹出</p>
    <script>
        p = document.getElementById("demo")
        p.onclick = function () {
            alert("我被点击了")
        }
    </script>
    
</body>
</html>